#!/usr/bin/env python

import os,sys

(d1, d2, d3) = os.getloadavg()

if d1 >= 90.0:
    print "Average - CRITICAL, Load balancing is probably broken: %.2f" % (d1)
    sys.exit(2)
elif d1 >= 50.0:
    print "Average - WARNING: Load balancing is on the edge or worse: is %.2f" % (d1)
    sys.exit(1)
elif d1 >= 25.0:
    print "Average - OK: Expected business: %.2f" % (d1)
    sys.exit(0)
else:
    print "Average - Warning: Check load balancing, way too low: %.2f" % (d1)
    sys.exit(1)
